<?php

namespace App\Admin\Controllers\Service;

use App\Http\Controllers\Controller;
use App\Models\Service;
use Dcat\Admin\Controllers\AdminController;
use Dcat\Admin\Grid;
use Illuminate\Http\Request;

class ServiceController extends AdminController
{

    public $title = '业务类别';

    /**
     * 列表
     * @return Grid
     */
    public function grid()
    {
        $grid = new Grid(new Service());
        $grid->id;
        $grid->column('name', '类别名称');
        $grid->column('status', '状态')->display(function ($status) {
            return Service::STATUS[$status];
        });
        $grid->disableCreateButton();

        $grid->disableActions();

        $grid->header();

        return $grid;
    }
}
